﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml;
using System.Collections.Generic;

public partial class Agent_SecurityPayments :AgentPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
            BindData();
        Agent_Vip_Menu.SelectMenu = 2;
    }
    protected void BindData()
    {
        #region 绑定年度服务费用
        XmlDocument xml = new XmlDocument();
        string xmlFilePath = Server.MapPath("~/App_Data/Charge.xml");
        if (!System.IO.File.Exists(xmlFilePath))
            throw new Exception("责任保证金配置文件不存在");
        xml.Load(xmlFilePath);
        XmlNodeList nodes = xml.SelectNodes("/charges/charge[@name='责任保证金']/charge");
        foreach (XmlNode node in nodes)
        {
            //Repeater
            recharge.Items.Add(node.InnerText);
        }


        #endregion

        #region 绑定合同附件
        pi.PageSize = int.MaxValue;

        pi.Where = "where articleid=11";
        List<MatchIns.Model.TFuJian> ds = new MatchIns.BLL.TFuJian().GetPageList(pi).List;
        if (ds.Count > 0)
        {
            down.HRef = "/UploadFile/FuJian/" + ds[0].FileName;
        }
        #endregion

        content.InnerHtml = GetArticle(11);

    }

    protected string GetArticle(int articleID)
    {
        MatchIns.Model.TArticle model = new MatchIns.BLL.TArticle().GetModel(articleID);
        if (model == null)
            return "";
        else
            return model.Content;
    }

}
